package com.tencent.sr.iris.activity.service.activity.impl;

import com.tencent.sr.iris.activity.interfaces.enums.ActivityIdEnum;
import com.tencent.sr.iris.activity.interfaces.request.acticity.BatchDataRequest;
import com.tencent.sr.iris.activity.interfaces.response.activity.BatchStatisticsResponse;
import com.tencent.sr.iris.activity.service.activity.AbstractNormalStatisticsHandler;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

@Component
public class SpecialStatisticsHandler extends AbstractNormalStatisticsHandler {

    @Override
    public BatchStatisticsResponse statistics(BatchDataRequest request) {
        BatchStatisticsResponse normalResponse = statisticNormalOrSpecial(false, request);
        BatchStatisticsResponse specialResponse = statisticNormalOrSpecial(true, request);
        return normalResponse
                .setSpecialParticipableUserCount(specialResponse.getParticipableUserCount())
                .setSpecialIsParticipatedUserCount(specialResponse.getIsParticipatedUserCount())
                .setSpecialFinishTaskUserCount(specialResponse.getFinishTaskUserCount())
                .setSpecialCommission(specialResponse.getCommission())
                .setSpecialEstimateCommission(specialResponse.getEstimateCommission());
    }


    @Override
    public List<String> supportedActivityIds() {
        return Arrays.asList(ActivityIdEnum.MONTH_GIFT.getCode());
    }
}
